<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <title>快乐拍宝</title>
    <link rel="stylesheet" href="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/_build/p/home/home_shangjia.css">
    <script src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/_build/c/index.js"></script>
    <!--    轮播图插件flickity-->
    <link rel="stylesheet" href=".<?php echo TEMPLATE_SITE_URL;?>/zsm-static/_build/c/flickity.css">
    <script src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/_build/c/flickity.pkgd.min.js"></script>
    <script src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/_build/c/jquery.min.js"></script>
</head>
<body>
<!--    首页小导航-->
<?php $zh_menu='商家推荐'?>
<?php include template('home/zsm/menu');?>
<div class="app">
    <section class="floor">
        <div class="tuuijian-list">
            <div class="example duo">
                <div class="example__demo duo__cell">
                    <div class="gallery js-flickity tuijian" data-flickity-options='{ "freeScroll": true,"contain": true}'>
                        <?php if(!empty($output['recommendstore'])):?>
                        <?php foreach($output['recommendstore'] as $val):?>
                        <div class="gallery-cell tuijian-list">
                            <a style="display:inline-block;z-index:999;" href="index.php?act=index&seller_id=<?php echo $val['user_id'];?>">
                                <div class="touxiang">
                                    <img src="<?php echo $val['avatar'];?>">
                                </div>
                            </a>
                            <div class="names">
                                <?php echo $val['nickname'];?>
                            </div>
                        </div>
                        <?php endforeach;?>
                        <?php endif;?>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="floor recommenddata">

    </section>
</div>
<input type="hidden" name="haspage" value="1" id="haspage">
<input type="hidden" name="pagenum" value="0" id="pagenum">
<script type="text/javascript">
    $(function(){
        $(window).scroll(function () {
            var $body = $("body");
            if (($(window).height() + $(window).scrollTop()) >= $body.height()) {
                var haspage = parseInt($('#haspage').val());
                if(haspage=='0'){
                    return false;
                }
                var pagenum = parseInt($('#pagenum').val());
                var nextpage = eval(pagenum+1);
                ajaxdata(nextpage);
            }
        });

        function ajaxdata(nextpage){
            $.ajax({
                type:'get',
                url:'index.php?act=jingxuan&op=recommendstoredata',
                data:{nextpage:nextpage},
                dataType:'html',
                success:function(html){
                    $('.loadNextPage').hide();
                    if(html==''){
                        $('#haspage').val('0');
                    }else{
                        $('#pagenum').val(nextpage);
                        $('.recommenddata').append(html);
                    }

                },
                beforeSend:function(){
                    $('.loadNextPage').show();
                }
            });
        }
        ajaxdata(1);
    });
</script>
<script type='text/javascript'>
    $(function(){
        var time = parseInt("<?php echo TIMESTAMP;?>");
        $('.process').each(function(){
            var lag = parseInt($(this).attr('endtime')) - time;
            if(lag>0){
                var second = Math.floor(lag % 60);
                var minite = Math.floor((lag / 60) % 60);
                var hour = Math.floor((lag / 3600) % 24);
                var day = Math.floor((lag / 3600) / 24);
                $(this).html('<span>&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span >&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span>&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span>'+second+'</span>');
            }
        });
        function updateEndTime(){
            time++;
            $(".process").each(function(){
                var lag = parseInt($(this).attr('endTime')) - time;
                if(lag>0){
                    var second = Math.floor(lag % 60);
                    var minite = Math.floor((lag / 60) % 60);
                    var hour = Math.floor((lag / 3600) % 24);
                    var day = Math.floor((lag / 3600) / 24);
                    $(this).html('<span>&nbsp;'+day+'&nbsp;</span>'+'<?php echo $lang['bearshop_day'];?>'+'<span>&nbsp;'+hour+'&nbsp;</span>'+'<?php echo $lang['bearshop_hour'];?>'+'<span>&nbsp;'+minite+"&nbsp;</span>"+'<?php echo $lang['bearshop_minute'];?>'+'<span>&nbsp;'+second+'&nbsp;</span>');
                }
            });
            setTimeout(updateEndTime,1000);
        }
        setTimeout(updateEndTime,1000);
    });
</script>
<!--引入导航菜单-->
<?php $zh_nav="首页";?>
<?php include template('home/zsm/nav');?>